﻿#ifndef REGISTERCODEC_H
#define REGISTERCODEC_H

#include <qobject.h>
#include "ObjAutoInject.h"
#include "DeviceRegisterCodecBase.h"

#include <qhash.h>

class Mapper_Device;
class DataPackage_UdpCodec;
class DeviceRegisterCodec : public QObject,public ObjAutoInject,public DeviceRegisterCodecBase
{
  Q_OBJECT
/*
注册类型8bit
*/
private://property
  QHash<unsigned char,DeviceRegisterCodecBase*> codecMap;
private://dependency
  Mapper_Device* mapper_Device=Q_NULLPTR;
public:
  explicit DeviceRegisterCodec();
  virtual ~DeviceRegisterCodec();
signals:
public:
  virtual DataPackage_UdpCodec* decode(DataPackage_UdpCodec* dataPackageInfo_Device)override;
  static DataPackage_UdpCodec* makeAck(DataPackage_UdpCodec *dataPackageInfo_Device,RegisterType registerType);
public://geter and seter
  Mapper_Device* getMapper_Device() const;
  DeviceRegisterCodec* setMapper_Device(Mapper_Device * const mapper_Device);
public:
  virtual void objectAutoInjection(QHash<QString,QObject*>* objMap)override;
};

#endif // REGISTERCODEC_H
